 package net.go176.backpack.command;
 
 import java.util.ArrayList;
 import java.util.List;
 import org.bukkit.command.Command;
 import org.bukkit.command.CommandSender;
 
 
 
 public abstract class CommandBase
 {
   protected CommandManager cmdMan;
   protected final List<String> labels = new ArrayList<>(1);
   protected String usage = null;
   protected String description = null;
   protected boolean playerOnly = false;
   protected String permission = null;
   
   public CommandBase(CommandManager cmdMan) {
     this.cmdMan = cmdMan;
   }
   
   protected void preExecute(CommandSender cs, Command cmd, String label, String[] args) {
     if (this.playerOnly && !(cs instanceof org.bukkit.entity.Player)) {
       CommandManager.sendMsg(cs, "&eOnly player can use this command");
       return;
     } 
    if (this.permission != null && !cs.hasPermission(this.permission) && !cs.hasPermission("mybackpack.command.*")) {
       CommandManager.sendMsg(cs, "&cNo permission");
       return;
     } 
     execute(cs, cmd, label, args);
   }
   
   protected boolean canTabComplete(CommandSender cs, Command cmd, String label, String[] args) {
     if (this.permission != null && !cs.hasPermission(this.permission) && !cs.hasPermission("mybackpack.command.*"))
       return false; 
     return true;
   }
   
   protected abstract void execute(CommandSender paramCommandSender, Command paramCommand, String paramString, String[] paramArrayOfString);
   
   protected abstract List<String> tabComplete(CommandSender paramCommandSender, Command paramCommand, String paramString, String[] paramArrayOfString);
 }


/* Location:              D:\User\Xuan\Downloads\MyBackpack1.2.5.jar!\net\saralab\mybackpack\command\CommandBase.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.1.3
 */